package com.itany.corejava.code07_面向对象.租车系统;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月06日 16:32
 */
public class Bus extends MotorVehicle{
    private int seaCount;

    public Bus(String no, String brand, int seaCount) {
        super(no, brand);
        this.seaCount = seaCount;
    }

    public int getSeaCount() {
        return seaCount;
    }

    public void setSeaCount(int seaCount) {
        this.seaCount = seaCount;
    }

    /**
     * 计算客车的租金
     *
     * @param day 租车的天数
     * @return
     */
    @Override
    public double rent(int day) {
        double sum=0;//租金的总金额
        if(seaCount<=30){
            sum=1000*day;
        }else{
            sum=2000*day;
        }
        return sum;
    }
}
